import Vue from 'vue'
import Vuex from 'vuex'
import user from './user'
import shopping from './shopping'
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    num: 0,
    title: 'vuex',
  },
  getters: {
  },
  mutations: {
    add(state, payload) {
      state.num += payload;
    },
    sub(state, payload) {
      state.num -= payload;
    },
    reset(state, payload) {
      state.num = payload;
    },
    changeTitle(state, payload) {
      state.title = payload;
    }
  },
  actions: {
  },
  modules: {
   user,
   shopping
  }
})
